#[macro_export]
macro_rules! pick {
    ($table:expr,$field:expr) => {
        $table.get($field).and_then(|s| s.as_str())
    };
    ($table:expr,$table_field:expr,$field:expr) => {
        $table
            .get($table_field)
            .and_then(|table| pick!(table, $field))
    };
}

#[macro_export]
macro_rules! combine_option {
    ($one:expr,$another:expr) => {
        $one.and_then(|one| $another.map(|another| (one, another)))
    };
    ($one:expr,$another:expr,$other:expr) => {
        $one.and_then(|one| $another.map(|another| (one, another)))
            .and_then(|(one, another)| $other.map(|other| (one, another, other)))
    };
    ($one:expr,$two:expr,$three:expr,$four:expr) => {
        $one.and_then(|one| $two.map(|two| (one, two)))
            .and_then(|(one, two)| $three.map(|three| (one, two, three)))
            .and_then(|(one, two, three)| $four.map(|four| (one, two, three, four)))
    };
}
